<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/core/common/taglibs.jsp" %>
<%@ include file="/WEB-INF/core/common/top.jsp" %>
<script language="javascript">
<!--   
   function doReset(id){
   		if(confirm("<s:text name='task.reset.confirm'/>"))
      		location.href="${ctx}/contentManage/importTask.action?act=resetTask&taskId="+id;
   }
   
   function importInput(){
   		location="${ctx}/contentManage/contentImport.action?act=doImportInput";
   }
   
   function batchImportInput(){
   		location="${ctx}/contentManage/contentImport.action?act=doBatchImportInput";
   }
   
   function importTask(){
		location="${ctx}/contentManage/importTask.action?q_status=0";
   }
   
   function viewMessage(taskId){
		document.getElementById("message").style.display="";  
		document.getElementById("info").src="${ctx}/contentManage/importTask.action?act=viewMessage&taskId="+taskId;    
   }
   
//-->     
</script>
<body style="overflow-x:hidden;overflow-y:auto;">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<%@include file="/WEB-INF/core/common/message.jsp"  %>
  <tr><td><table border="0" align="center" cellpadding="0" cellspacing="0">
    <td width="8" height="27"><img src="${ctx}/core/images/button_05.gif" width="8" height="27" /></td>
    <td width="99%" align="left" background="${ctx}/core/images/button_06.gif" class="bluecu">&nbsp;<img src="${ctx}/core/images/icon_04.gif" />&nbsp;<s:text name="content.import"/></td>
    <td width="8"><img src="${ctx}/core/images/button_07.gif" width="8" height="27" /></td>
    </table>
    </td>
  </tr>
  
  <tr>
    <td colspan="3" class="biaoge">	
      <table width="100%" height="21" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
        <td onClick="javascript:importInput();">
              <table cellpadding="0" cellspacing="0" width="100%" style="width:60px;cursor:hand;">
                <tr>
                  <td width="5" class="tab_underline1"><img src="${ctx}/core/images/gray_left.gif" /></td>
                  <td align="center" class="tab_button_gray" nowrap="nowrap">&nbsp;<s:text name="adi.import"/>&nbsp;</td>
                  <td width="5" class="tab_underline1"><img src="${ctx}/core/images/gray_right.gif" /></td>
                </tr>
            </table></td>
         <td onClick="javascript:batchImportInput();">
              <table cellpadding="0" cellspacing="0" width="100%" style="width:60px;cursor:hand;">
                <tr>
                  <td width="5" class="tab_underline1"><img src="${ctx}/core/images/gray_left.gif" /></td>
                  <td align="center" class="tab_button_gray" nowrap="nowrap">&nbsp;<s:text name="adi.batch.import"/>&nbsp;</td>
                  <td width="5" class="tab_underline1"><img src="${ctx}/core/images/gray_right.gif" /></td>
                </tr>
            </table></td>
         <td onClick="javascript:importTask();">
              <table cellpadding="0" cellspacing="0" width="100%" style="width:60px;cursor:hand;">
                <tr>
                  <td width="5" ><img src="${ctx}/core/images/blue_left.gif" /></td>
                  <td align="center" class="tab_button_blue" nowrap="nowrap">&nbsp;<s:text name="adi.import.task"/>&nbsp;</td>
                  <td width="5" ><img src="${ctx}/core/images/blue_right.gif" /></td>
                </tr>
            </table></td>
        <td width="90%" class="tab_underline1">&nbsp;</td>
      </tr>
      </table>     
	     <table width="100%" border="0" cellspacing="0" cellpadding="0">
	      <form name="searchForm" method="post"  action="${ctx}/contentManage/importTask.action?act=query">
	<tr>
        <td height="10"></td>
      </tr>  
	  <tr>
		<!-- 查询条件 -->
	    <td class="tabulation" colspan="3"><div style="position:relative">
	     
	        <table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF">
				    <tr align="right">
				        <td bgcolor="#DDE4EA"><s:text name="adi.task.status"/>&nbsp;&nbsp;
				            <select name="q_status" onchange="searchForm.submit();">
				            	<option value="0"><s:text name="task.running"/></option>
				            	<option value="1"><s:text name="task.completed"/></option>
				            	<option value="2"><s:text name="task.failed"/></option>
				            </select>
				            <script>searchForm.q_status.value='<s:property value="q_status"/>'</script>
				        </td>
				    </tr> 	       
			</table> </div></td>
	<!-- 查询条件结束 -->

  </tr>
  <tr>
    <td height="5"></td>
  </tr>
  <tr>
    <td height="10" background="${ctx}/core/images/line5.gif"></td>
    </tr>
  <tr>
    <td height="5"></td>
  </tr>
  	</form>
	      </table>
        <!--查询-->
      <table id="content" width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#A6A6A6">
        <tr bgcolor="#C7D6EA">
          <td width="5%" height="20" align="center" class="table_head"><s:text name="adi.task.id" /></td>
          <td width="20%" align="center" class="table_head" ><s:text name="adi.task.name" /></td>
          <td width="20%" align="center" class="table_head"><s:text name="asset.code" /></td>
          <td width="20%" align="center" class="table_head"><s:text name="task.creation.time" /></td>
          <td width="10%" align="center" class="table_head">Site ID</td>
          <td width="10%" align="center" class="table_head"><s:text name="adi.task.status" /></td>
          <s:if test="q_status==2">
          <td width="10%" align="center" class="table_head"><s:text name="info.operate" /></td>
          </s:if>
        </tr>
 		<s:iterator value="pageInfo.searchResult" id="it" status="st">
	        <tr>
	          <td height="20" align="center"><exts:property value="0"/></td>
	          <td align="center"><exts:property value="1"/></td>
	          <td align="center"><exts:property value="2"/></td>
	          <td align="center"><exts:property value="3"/></td>
	          <td align="center"><exts:property value="5"/></td>
	          <td align="center"><s:if test="#it[4]==0"><s:text name="task.running"/></s:if>
	          <s:if test="#it[4]==1"><s:text name="task.completed"/></s:if>
	          <s:if test="#it[4]==2"><a title="<s:text name='task.error.info'/>" href="javascript:viewMessage(<exts:property value='0'/>);"><s:text name="task.failed"/></a></s:if></td>
	          <s:if test="q_status==2">
	          <td align="center">
	          	<table height="16" border="0" cellpadding="0" cellspacing="0">
	                <tr>
		                <td width="22" align="right"><a href="javascript:doReset(<exts:property value='0'/>)"><img src="${ctx}/core/images/import.gif" name="icon_064"  border="0" id="icon_064" style="CURSOR: hand" title="<s:text name='task.reset'/>"/></a></td>
	                </tr>
	          	</table>
	          </td>
	          </s:if>
	        </tr>
	    </s:iterator>
	    
      </table>
 <script>
	tables('content',null);
</script>   
      <!-- 分页 -->	  
		  <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr><td>${pagination}</td></tr>
          </table>
      <!-- 分页结束 -->	
    </td></tr>
    </table>
    
    <table width="100%" id="message" style="display:none" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
    		<td height="5"></td>
  		</tr>
        <tr>
        	<td>
        		<iframe src=""  frameborder="0" height="250" width="100%" name="info" />
        	</td>
        </tr>
   	</table> 
</body>
  
